﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"   EnableSessionState="True" 
    CodeBehind="Revenue.aspx.cs" Inherits="Client_Revenue.Revenue" EnableViewState="True" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link type="text/css" href="Styles/datagrid.css" rel="stylesheet" />
    <link type="text/css" href="Styles/detailgrid.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <%--  <asp:ScriptManager ID="ScriptManager1" runat="server" />--%>
    <h2>
        Commissions Received
    </h2>
    <table style="text-align: justify; vertical-align: top; padding: 10 0 0 10; width: 100%">
        <tr>
            <td valign="top">
                <asp:Panel ID="pnUpload" runat="server">
                    <asp:UpdatePanel ID="upCommissions" runat="server">
                        <ContentTemplate>
                            <table style="text-align: justify; vertical-align: top; padding: 10 0 0 10; width: 100%">
                                <tr>
                                    <td style="text-align: justify; vertical-align: top; top: 5px;">
                                        <h4>
                                            Upload Commisions</h4>
                                        <asp:FileUpload ID="CarrierComFileUpload" runat="server" />
                                    </td>
                                    <td>
                                      <h4>Commission received date</h4>
                                        <asp:TextBox ID="txtReceivedDate" runat="server"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Button ID="bnUpload" runat="server" Text="Upload  File" OnClick="bnUpload_Click"
                                            CausesValidation="False" />
                                    </td>
                                     <td>
                                        <asp:Button ID="btnReceivedComm" runat="server" Text="Get Commision by date" OnClick="btnReceivedComm_Click"
                                            CausesValidation="False" />
                                    </td>
                                </tr> 
                                <tr>
                                    <td colspan="2">
                                        <asp:Label ID="lblInfo" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:GridView ID="gvCommissions" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                         OnPageIndexChanging="gvCommissions_PageIndexChanging"
                                            OnSelectedIndexChanged="gvCommissions_SelectedIndexChanged" 
                                            CssClass="datagrid" PageSize="200">
                                            <Columns>
                                                <asp:CommandField ShowSelectButton="True" />
                                                <asp:BoundField DataField="CarrierName" HeaderText="Carrier" SortExpression="CarrierName" />
                                                <%--<asp:TemplateField HeaderText="Revenue Type" SortExpression="RevenueTypeName">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("RevenueTypeId") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("RevenueTypeName") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>--%>
                                                <asp:BoundField DataField="Commission_ReceivedAmt" HeaderText="Received Amount ($)"  DataFormatString="{0:c2}"/>
                                                <%-- <asp:TemplateField HeaderText="Commission (%)">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtCommission" runat="server" Text='<%# Bind("Commission") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Commission") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>--%>
                                                <asp:BoundField DataField="QB_InvoiceNum" HeaderText="QB Invoice Num" />
                                                <asp:BoundField DataField="ReceiptDate" DataFormatString="{0:d}" HeaderText="Date Received" />
                                                <asp:HyperLinkField Text="item Details..." HeaderText="Check Item Details" 
                                                target="_blank"
                                                DataNavigateUrlFields="QB_InvoiceNum"
                                                DataNavigateUrlFormatString="~/ContractItemizedReceipt.aspx?InvNum={0}" />
                                            </Columns>
                                            <SelectedRowStyle BackColor="LightGray"></SelectedRowStyle>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:PostBackTrigger ControlID="bnUpload" />
                            <%--<asp:AsyncPostBackTrigger ControlID="bnUpload" EventName="Click" />--%>
                        </Triggers>
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td style="text-align: center;" colspan="2">
                <%-- <asp:Button runat="server" ID="btSave" Text="Save" Width="108px" OnClick="btAddSave_Click" />&nbsp;&nbsp;&nbsp;
                <asp:Button runat="server" ID="btnCancel" Text="Cancel" Width="108px" OnClick="btnCancel_Click"
                    CausesValidation="false" />--%>
            </td>
        </tr>
    </table>
</asp:Content>
